﻿using System;
using System.Linq;

namespace Basmus.Resources
{
    public class PathAttributeResolver : IPathResolver
    {
        public string Resolve(Type type)
        {
            var attribute = type
                .GetCustomAttributes(typeof(PathAttribute), false)
                .Cast<PathAttribute>()
                .FirstOrDefault();
            if (attribute == null)
                return null;
            return attribute.Path;
        }
    }
}